import { action, makeObservable, observable } from "mobx";

export class ImagePreviewStore {
    url: string | null = null;
    top: number = 0;
    width: number = 0;
    height: number = 0;

    constructor() {
        makeObservable(this, {
            url: observable,
            setUrl: action,
            top: observable,
            setTop: action,
            setSize: action,
            width: observable,
            height: observable,
        });
    }

    public setUrl(url: string | null) {
        this.url = url;
    }

    public setTop(top: number) {
        this.top = top;
    }

    public setSize(width: number, height: number) {
        this.width = width;
        this.height = height;
    }
}

export default new ImagePreviewStore();
